<template>
  <header>
    <div class="left_content">
      <img src="../assets/icon.png" />
      <span is-show="showMenu" class="iconfont menu" @click="TOGGLE_SIDEBAR" :class="!sidebar?'icon-foldLeft':'icon-foldRight'"></span>
    </div>
    <div class="right_content">
      <slot></slot>
      <img class="language" src="../assets/cn.png" />
    </div>
  </header>
</template>

<script>
import {mapMutations,mapGetters} from 'vuex';

export default {
  name: "MyHeader",
  prop:['showMenu'],
  methods:{
    ...mapMutations(['TOGGLE_SIDEBAR'])
  },
  computed: {
    ...mapGetters(['sidebar'])
  }
};
</script>

<style scoped lang="scss">
header {
  width: 100%;
  height: 50px;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  background-color: white;
  font-size: 13px;
  align-items: center;

  .left_content {
    display: flex;
    height: 50px;
    width: 200px;
    align-items: center;
    justify-content: space-around;
    img {
      width: 110px;
      margin-left: 20px;
    }
  }
  .right_content {
    height: 50px;
    line-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    img {
      width: 30px;
      height: 30px;
      margin: 0 10px;
      vertical-align: middle;
    }
    a {
      padding: 0px 10px;
      line-height: 20px;
      color: rgb(0, 157, 255);
      border-left: 1px solid #999;
    }
    .language {
      width: 50px;
      height: 50px;
      float: right;
      margin: 0;
    }
  }
}
</style>